Field of the Invention
The present disclosure generally relates to image processing and, more particularly, to an image processing method and a device system for changing an imaging parameter of a camera and capturing an image-to-be-checked and for adjusting the imaging parameter as necessary.
Description of the Related Art
With a widely known image processing method, for example, the presence and absence of an object are determined, and if the presence is determined, an image of the object is captured, image processing is performed, the position and phase of the object are measured, and a surface state is inspected to find a non-defective piece.
With such an image processing method, first, image data is normally acquired having appropriate brightness distribution, color density distribution, brightness gradient, and the like in order to obtain appropriate image processing results. Therefore, it is important to adjust various imaging parameters such as exposure time, amplification of a signal (gain), and aperture size at the time of capturing an image. Even so, appropriate image data is not acquired when the external environment changes, for example, when lighting is degraded over time, when an indoor or outdoor environment changes, or when light is blocked temporarily (e.g., when a human or a device operation generates a shadow). In a case of industrial manufacture, for example, where objects having shapes conforming to predetermined standards are inspected, the quality, shape, or material of surfaces may differ for each piece, which may result in a failure of acquiring appropriate image data.
In a case in which the image processing results include a defect, a user may have to stop the operation of a device and adjust the imaging parameters. Unfortunately, this decreases the operating efficiency of the device.
To overcome the above problem, Japanese Patent Laid-Open No. 2009-139239 discloses a technique of calculating a value of brightness of acquired image data in a predetermined area and determining whether or not the value falls within a predetermined range of brightness values. If the calculated brightness value is not within the predetermined range of brightness values, an imaging parameter is changed and image data is repeatedly acquired until the brightness of the acquired image data in the predetermined area falls within the predetermined range of brightness values.
Image data that is acquired subsequently through such an adjusting step is to be subjected to predetermined image processing by using the adjusted range of brightness values as a new basis. This technique can be used to acquire image data that is appropriate for image processing by determining, even during operation of the device, whether or not the imaging parameter is appropriate on the basis of the brightness value of the image data in the predetermined area and adjusting the imaging parameter directly.
However, with this method for directly adjusting the imaging parameter as disclosed in Japanese Patent Laid-Open No. 2009-139239, image processing is performed after the adjustment of the imaging parameter so that the predetermined brightness value can be obtained. Accordingly, in some cases, the image processing results are not satisfactory.
When the cause of the inappropriate image processing results is poor lighting, it may be impossible to acquire image data of the object having appropriate brightness distribution, thereby producing the inappropriate image processing results. For example, the amount of characteristic information of the object, such as brightness gradient, brightness distribution, or color density distribution, may decrease; the position and phase may be measured with less accuracy; and the presence and absence determination may fail.
Additionally, direct adjustment may lead to user's misadjustment in actual manufacturing sites, which may result in a decrease in the accuracy with which the object is measured, false detection of non-defective pieces as defective pieces, or false detection of defective pieces as non-defective pieces.
The present disclosure has been made in view of the above circumstances and provides an image processing method and a device system in which the operation of a device is less affected by temporary variations of an object or external factors.